package com.example.demo.ReentrantLock锁.condition;

import java.util.concurrent.locks.Condition;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;

/**
 * @description:
 * @projectName:demo
 * @see:ReentrantLock锁.condition
 * @author:袁成龙
 * @createTime:2020/10/9 13:33
 * @version:1.0
 */
public class TestCon {

    public static void main(String[] args) {

        Lock lock = new ReentrantLock();
        Condition condition = lock.newCondition();

        Thread thread1 = new Thread(new TestCondition(condition,lock));
        Thread thread2 = new Thread(new TestCondition2(condition,lock));

        thread1.start();
        thread2.start();


    }
}